<!--
  Copyright 2020 The Chromium Authors. All rights reserved.
  Use of this source code is governed by a BSD-style license that can be
  found in the LICENSE file.
-->
<script>
  const script = document.createElement('script');
  script.textContent = 'console.log("script element")';
  document.head.appendChild(script);

  document.write('<script>console.log("document.write from onload");<\/script>');
</script>
